Skip to content

fix(jwk): as_dict, as_pem, as_der export public key by default#100

Merged
lepture merged 1 commit into
mainfrom
export-public
Jun 2, 2026
Merged

fix(jwk): as_dict, as_pem, as_der export public key by default#100
lepture merged 1 commit into
mainfrom
export-public

Conversation

@lepture

@lepture lepture commented May 31, 2026

Copy link
Copy Markdown
Member

#99

@lepture lepture requested a review from azmeuk May 31, 2026 11:52
@codecov

codecov Bot commented May 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (955aaa0) to head (382b39d).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #100   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           47        47           
  Lines         2911      2910    -1     
  Branches       343       341    -2     
=========================================
- Hits          2911      2910    -1     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud

Copy link
Copy Markdown

@authlib authlib deleted a comment from sonarqubecloud Bot Jun 1, 2026
@azmeuk

azmeuk commented Jun 1, 2026

Copy link
Copy Markdown
Member

Surprising that now OctKey dumps the secret with private=False

>>> from joserfc.jwk import OctKey
>>> key = OctKey.import_key("foobar")
>>> key.as_dict(private=False)
{'k': 'Zm9vYmFy', 'kty': 'oct'}
>>> key.as_dict(private=True)
{'k': 'Zm9vYmFy', 'kty': 'oct'}

It is a voluntary change?

@lepture

lepture commented Jun 2, 2026

Copy link
Copy Markdown
Member Author

For OctKey, there is no private or public.

@azmeuk

azmeuk commented Jun 2, 2026

Copy link
Copy Markdown
Member

Yes, I was just noticing this because the original issue intent is to not leak secrets by default when calling as_dict.
LGTM anyway.

@lepture lepture merged commit da5dba1 into main Jun 2, 2026
24 checks passed
@lepture lepture deleted the export-public branch June 2, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants